/**
 *
 * */
Rsd.define('Rsd.Faith.controls.YinHangInput', {
    extend: 'Rsd.control.AutoComplete',
    xtype: 'ctrl-yinhang',
    requires: ['Rsd.Faith.stores.YinHangStore'],
    margin: '0 0 0 0',
    autoCompleteHandler:'auto_complete',

    /*
    * */
    constructor: function ListMenu(config) {

        this.apply(config);

    },
    auto_complete:function(value,callback)
    {
        var _list = [];
        if(Rsd.isEmpty(value))
        {
            callback(_list);
            return;
        }

        var _store = Rsd.create('Rsd.Faith.stores.YinHangStore',{});
        _store.load({},function (data) {

            var list = data.data.rows;
            var str = '';
            for(var i in list)
            {
                str = list[i].YinHangMingCheng;
                if(str.indexOf(value)<0)
                {
                    continue;
                }
                else
                {
                    _list.push({id:'b_'+list[i].KaiHuZhangHao,key:list[i].KaiHuZhangHao,text:list[i].YinHangMingCheng+'('+list[i].KaiHuZhangHao+')'} );

                }
            }

            callback(_list);
        });

    }


},function(type) {

});
